package com.leyou.common.exception;

import com.leyou.common.enums.ExceptionEnum;
import lombok.Getter;

/**
 * 自定义异常类
 *
 * @author xxx
 */
@Getter
public class LyException extends RuntimeException {
    /**
     * 状态码
     */
    private Integer status;

    public LyException(Integer status, String message) {
        super(message);
        this.status = status;
    }

    /**
     * 带参的构造方法
     * @param e 枚举参数
     */
    public LyException(ExceptionEnum e) {
        super(e.getMessage());
        this.status = e.getStatus();
    }
}
